package com.fc.controller;

import com.fc.entity.SysPermission;
import com.fc.service.SysPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@RequestMapping("/page")
@Controller
public class PageController {
    @Autowired
    private SysPermissionService sysPermissionService;

    @GetMapping("/toIndex" )
    public ModelAndView toIndex(){
        ModelAndView mv=new ModelAndView();
        List<SysPermission> list = sysPermissionService.getPermisisonList();
        mv.setViewName("/index" );
        mv.addObject("menuList",list);
        return mv;
    }

}
